<SCRIPT type="text/javascript">
	var setting = {
		data: {
			simpleData: {
				enable: true
			}
		},
		callback: {
			//onCollapse: alert("up"),
			onExpand: function(){
				if (treeNiceScroll) {
					treeNiceScroll.resize();
				}
			}
		},
		view: {
			showLine: false
		}
	};
	var zNodes1 =[
		{ id:"taskpassing", pId:0, name:"当前活动", open:true, icon:"/assets/images/icon-file-closed.png", url:"/${orgi}/manage/task/taskpassing.html<#if uid??>?userid=${uid!''}</#if>",target:"_self"},
		{ id:"taskpassed", pId:0, name:"过去的活动", open:true, icon:"/assets/images/icon-file-closed.png", url:"/${orgi}/manage/task/taskpassed.html<#if uid??>?userid=${uid!''}</#if>",target:"_self"},
		{ id:"taskwillpass", pId:0, name:"即将进行的活动", open:true, icon:"/assets/images/icon-file-closed.png", url:"/${orgi}/manage/task/taskwillpass.html<#if uid??>?userid=${uid!''}</#if>",target:"_self"},
		{ id:"onlineuser", pId:0, name:"在线用户", open:true, icon:"/assets/images/icon-file-closed.png", url:"/${orgi}/manage/task/onlineuser.html",target:"_self"},
		//{ id:"allplan", pId:0, name:"所有计划中的任务", open:true, icon:"/assets/images/icon-file-closed.png", url:"/${orgi}/manage/task/allplan.html",target:"_self"} ,
		{ id:"allwarn", pId:0, name:"所有预警项", open:true, icon:"/assets/images/icon-file-closed.png", url:"/${orgi}/manage/task/warn/searchsetting.html",target:"_self"}
	];
	
	function selectUser(){
		var id = $("input[name='userids']:checked").val();
		if(id==undefined){
			$("#userid").val("");
			$("#usernametext").html("任意");
			$("#username").val("");
		}else{
			$("#userid").val(id);
			$("#usernametext").html($("#username_td_"+id).html());
			$("#username").val($("#username_td_"+id).html());
		}
		
		
		closeR3ArtDialog();
	}
	function selectReport(){
		var id = $("input[name='reportids']:checked").val();
		if(id==undefined){
			$("#reportid").val("");
			$("#reportnametext").html("任意");
			$("#reportname").val("");
		}else{
			$("#reportid").val(id);
			$("#reportnametext").html($("#username_td_"+id).html());
			$("#reportname").val($("#username_td_"+id).html());
		}
		var treeObj = $.fn.zTree.getZTreeObj("zTree_report_dic_LIst");
		var nodes = treeObj.getCheckedNodes(true);
		if(nodes.length>0){
			var node = nodes[0];
			$("#dicid").val(node.id);
			$("#dicnametext").html(node.name);
			$("#dicname").val(node.name);
		}else{
			$("#dicid").val("");
			$("#dicnametext").html("任意");
			$("#dicname").val("");
		}
		closeR3ArtDialog();
	}
	function submitSearchForm(action){
		$("#beginNum").val($("#beginNumShow").val());
		$("#endNum").val($("#endNumShow").val());
		var reg = /^[0-9]*$/;
		if(reg.test($("#beginNum").val())&&reg.test($("#endNum").val())&&(parseInt($("#endNum").val())>=parseInt($("#beginNum").val()))){
			$("#action").val(action);
			$("#searchForm").submit();
		}else{
			alertMsg("请输入正确的页码信息！");
		}
	}
	function timeEnable(){
		
		if($("input[name='timeType']:checked").val()==1){
			$("#beginTime").attr("disabled",true);
			$("#endTime").attr("disabled",true);
			$("#times").attr("disabled",false);
		}else{
			$("#beginTime").attr("disabled",false);
			$("#endTime").attr("disabled",false);
			$("#times").attr("disabled",true);
		}
	}
	
	function cancelMsg(data){
		art.dialog(data);
	}
	
</SCRIPT>
